<template>
  <div class="nav">
    <div class="n-center">
      <div class="nc-inline">
        <input type="text" class="nci-input" v-model="searchShop" @input="searchShopInput" placeholder="请输入关键词">
        <a :href="searchShopHref" class="nci-button">搜 索</a>
        <div class="nci-hot">
          <a :href="`${config.domain}/dmsc/jiaoyu/`" class="ncih-a">教育</a>
          <a :href="`${config.domain}/dmsc/zhaopin/`" class="ncih-a">招聘</a>
          <a :href="`${config.domain}/dmsc/shangcheng/`" class="ncih-a">商城</a>
          <a :href="`${config.domain}/dmsc/guanwang/`" class="ncih-a">官网</a>
        </div>
      </div>
      <a target="_blank" :href="`${config.domain}/khal/`" class="chat-a chat-a-shop">
        <strong class="ca-text">客户案例</strong>
        <i class="ca-icon"></i>
      </a>
    </div>
  </div>
</template>

<script>
export default {
  props: ['config'],
  data() {
    return {
      searchShop: '',
      searchShopHref: `${this.config.domain}/dmsc/`
    }
  },
  methods: {
    // 搜索关键词
    searchShopInput() {
      this.searchShopHref = `${this.config.domain}/dmsc/`
      if (this.searchShop) {
        this.searchShopHref = `${this.config.domain}/dmsc/?keyword=${this.searchShop}`
      }
    }
  }
}
</script>